<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="static/html5shiv.js"></script>
<script type="text/javascript" src="static/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/h-ui.admin/css/style.css" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/layer/2.4/skin/layer.css" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/css/magic-input.min.css" />
<!--[if IE 6]>
<script type="text/javascript" src="static/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>我的订单</title>
</head>
  
<body>
<div class="page-container">
<div class="mt-10">
	<table class="table table-border table-bg table-hover table-sort table-responsive" >
		<thead id="t-head">
			<tr class="text-c">
				<th>订单号</th>
				<th>支付方式</th>
				<th>支付平台</th>
				<th>流水号</th>
				<th>购买商品</th>
				<th>付费金额(元)</th>
				<th>订单状态</th>
				<th>下单时间</th>
			</tr>
		</thead>
		<tbody id="orderList">
      		<tr id="empty" style="display: none;"><td colspan="8"><span style="font-size: 16px">暂无购买记录......</span></td></tr>
		</tbody>
	</table>
</div>
</div>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath}/static/layer/2.4/layer.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/laypage/1.2/laypage.js"></script>
<script type="text/javascript">
$(function(){
	$.ajax({
		type: "post",
		url: "${pageContext.request.contextPath}/order/order_detail.action",
		dataType: "json",
		success: function(_data){
			if(_data.status == 0){
				console.log(_data.data == "");
				if(_data.data == ""){
					$("#empty").show();
				}else{
					$("#empty").hide();
					var html = "";
					$.each(_data.data,function(index,content){
						html +=
							'<tr class="text-c">'
								+'<td>'+content.orderNo+'</td>'
								+'<td>'+content.paymentType+'</td>'
								+'<td>'+content.payPlatform+'</td>'
								+'<td>'+content.platformNumber+'</td>'
								+'<td>'+content.tradeName+'</td>'
								+'<td>'+content.payment+'</td>'
								+'<td>'+content.status+'</td>'
								+'<td>'+content.createTime+'</td>'
							+'</tr>';
						});
					$("#orderList").append(html);
					}
			}else{
				alert("未知错误");
			}
		}
	});
});
</script>
</body>
</html>
